<template>
	<view class="container">
		
		<view class="content">
			<view class="label" >
				<view style="width: 70%;">
					<text class="t1">到家佳售后电话详情</text>
				</view>
				<view style="text-align: right;width: 30%;">
					<!-- <text class="t1_2">去领取 ></text> -->
				</view>
			</view>
			
			<block v-for="(item, index) in datalist" :key="index">
				<view class="item" @tap="call" :data-tel="item.tel">
					<view class="f1">
						<image :src='item.img'></image>
						<view class="t2">
							<text class="x1">{{item.tel}}</text>
							<text class="x2">到家佳客服</text>
							<!-- <text class="x2">{{dateFormat(item.createtime,'Y-m-d H:i')}}</text> -->
						</view>
					</view>
					<view class="f2">
						<view class="x1" style="color: green;font-size: 30rpx;">点击拨号</view>
					</view>
				</view>
			</block>
		</view>

	</view>
</template>

<script>
	var app = getApp();

	export default {
		data() {
			return {
				opt: {},
				loading: false,
				datalist: []
			};
		},

		onLoad: function(opt) {
			this.opt = app.getopts(opt);
			this.getdata();
		},
		onPullDownRefresh: function() {
			this.getdata();
		},
		methods: {
			getdata: function(loadmore) {
				var that = this;
				that.loading = true;
				app.post('ApiAgent/kfphone', {}, function(res) {
					that.loading = false;
					that.datalist = res.data;
				});
			},
			call: function(e) {
				var tel = e.currentTarget.dataset.tel;
				if (tel.indexOf('*') > -1) return;
				uni.makePhoneCall({
					phoneNumber: tel
				});
			},
		}
	};
</script>
<style>

	.t1_2{
		color: #333;
		font-weight: bold;
		font-size: 30rpx;
		
	}
	
	.content {
		width: 94%;
		margin: 0 3%;
		border-radius: 16rpx;
		background: #fff;
		margin-top: 20rpx;
	}

	.content .label {
		display: flex;
		width: 100%;
		padding: 16rpx;
		color: #333;
	}
	
	.content .t1 {
		font-weight: bold;
		color: #333;
		font-size: 30rpx;
	}

	.content .item {
		width: 100%;
		padding: 32rpx;
		border-top: 1px #eaeaea solid;
		min-height: 112rpx;
		display: flex;
		align-items: center;
	}

	.content .item image {
		width: 90rpx;
		height: 90rpx;
		border-radius: 4px
	}

	.content .item .f1 {
		display: flex;
		flex: 1;
		align-items: center;
	}
	
	.content .item .f2 {
		/* width: 40%; */
	}

	.content .item .f1 .t2 {
		display: flex;
		flex-direction: column;
		padding-left: 20rpx;
	}

	.content .item .f1 .t2 .x1 {
		color: #333;
		font-size: 26rpx;
		font-weight: bold;
	}

	.content .item .f1 .t2 .x2 {
		color: #999;
		font-size: 24rpx;
	}
</style>